@import (reference) './variable.less';

@popupPrefix: ant-popup;

.@{popupPrefix} {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 998;
  touch-action: none;
  &-top-image {
    width: 100%;
  }
  &-mask {
    width: 100%;
    height: 100%;
    background-color: @popup-mask-product;
    animation-fill-mode: forwards;
    &-closing {
      animation-name: ant-popup-mask-close;
    }
  }
  &-content {
    overflow: hidden;
    position: fixed;
    background: @popup-background;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
    color: @popup-color;
    &-bg {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      background-size: cover;
      background-repeat: no-repeat;
    }
    &-header {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 114rpx;
      position: relative;
      &-title {
        font-family: 500;
        line-height: 50 * @rpx;
        font-size: 36 * @rpx;
        color: @popup-color;
        text-align: center;
      }
      &-icon {
        width: 48 * @rpx;
        height: 48 * @rpx;
        font-size: 42 * @rpx;
        position: absolute;
        top: 33 * @rpx;
        color: @popup-assit-color;
        display: flex;
        justify-content: center;
        align-items: center;
        &-back {
          left: 24 * @rpx;
        }
        &-close {
          right: 24 * @rpx;
        }
      }
    }
  }
  &-transform {
    &-top {
      top: 0;
      left: 0;
      right: 0;
      animation-name: ant-popup-transform-top;
      border-radius: 0 0 @popup-radius @popup-radius;
      &-close {
        animation-name: ant-popup-transform-top-close;
      }
    }
    &-right {
      top: 0;
      right: 0;
      bottom: 0;
      animation-name: ant-popup-transform-right;
      &-close {
        animation-name: ant-popup-transform-right-close;
      }
    }
    &-bottom {
      left: 0;
      right: 0;
      bottom: 0;
      animation-name: ant-popup-transform-bottom;
      border-radius: @popup-radius @popup-radius 0 0;
      &-close {
        animation-name: ant-popup-transform-bottom-close;
      }
    }
    &-left {
      top: 0;
      left: 0;
      bottom: 0;
      animation-name: ant-popup-transform-left;
      &-close {
        animation-name: ant-popup-transform-left-close;
      }
    }
    &-center {
      top: 50%;
      left: 50%;
      transform: translate3d(-50%, -50%, 0);
      animation-name: ant-popup-transform-center;
      border-radius: @popup-radius;
      background: none;
      &-close {
        animation-name: ant-popup-transform-center-close;
      }
    }
  }
  &-position {
    &-top {
      top: 0;
      left: 0;
      right: 0;
      animation-name: ant-popup-position-top;
      border-radius: 0 0 @popup-radius @popup-radius;
      &-close {
        animation-name: ant-popup-position-top-close;
      }
    }
    &-right {
      top: 0;
      right: 0;
      bottom: 0;
      animation-name: ant-popup-position-right;
      &-close {
        animation-name: ant-popup-position-right-close;
      }
    }
    &-bottom {
      left: 0;
      right: 0;
      bottom: 0;
      animation-name: ant-popup-position-bottom;
      border-radius: @popup-radius @popup-radius 0 0;
      &-close {
        animation-name: ant-popup-position-bottom-close;
      }
    }
    &-left {
      top: 0;
      left: 0;
      bottom: 0;
      animation-name: ant-popup-position-left;
      &-close {
        animation-name: ant-popup-position-left-close;
      }
    }
    &-center {
      top: 50%;
      left: 50%;
      transform: translate3d(-50%, -50%, 0);
      animation-name: ant-popup-position-center;
      border-radius: @popup-radius;
      background: none;
      &-close {
        animation-name: ant-popup-position-center-close;
      }
    }
  }
}

@keyframes ant-popup-transform-top {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes ant-popup-transform-bottom {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes ant-popup-transform-left {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes ant-popup-transform-right {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes ant-popup-transform-center {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(0.1);
    opacity: 0;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    opacity: 1;
  }
}

@keyframes ant-popup-transform-top-close {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

@keyframes ant-popup-transform-bottom-close {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes ant-popup-transform-left-close {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes ant-popup-transform-right-close {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes ant-popup-transform-center-close {
  0% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
  20% {
    opacity: 0.8;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
  }
}
@keyframes ant-popup-position-top {
  0% {
    top: -100%;
  }
  100% {
    top: 0;
  }
}

@keyframes ant-popup-position-bottom {
  0% {
    bottom: -100%;
  }
  100% {
    bottom: 0;
  }
}

@keyframes ant-popup-position-left {
  0% {
    left: -100%;
  }
  100% {
    left: 0;
  }
}

@keyframes ant-popup-position-right {
  0% {
    right: -100%;
  }
  100% {
    right: 0;
  }
}

@keyframes ant-popup-position-center {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(0.1);
    opacity: 0;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    opacity: 1;
  }
}

@keyframes ant-popup-position-top-close {
  0% {
    top: 0;
  }
  100% {
    top: -100%;
  }
}

@keyframes ant-popup-position-bottom-close {
  0% {
    bottom: 0;
  }
  100% {
    bottom: -100%;
  }
}

@keyframes ant-popup-position-left-close {
  0% {
    left: 0;
  }
  100% {
    left: -100%;
  }
}

@keyframes ant-popup-position-right-close {
  0% {
    right: 0;
  }
  100% {
    right: -100%;
  }
}

@keyframes ant-popup-position-center-close {
  0% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
  20% {
    opacity: 0.8;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
  }
}

@keyframes ant-popup-mask-close {
  0% {
    background-color: @popup-mask-product;
  }
  100% {
    background-color: @popup-mask-close-bg;
  }
}
